<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>添加部门</title>
	<#include "./comm/meta-base.ftl" />
	<#include "./comm/meta-easyui.ftl" />
	<#include "./comm/meta-comm.ftl" />
</head>
<body>
		
<form id="data_form" role="form" class="page-form"   method="post" >
	<!--表单块-->
	<div class="form-title">部门基础信息</div>
	<div class="row">
		<div class="form-group col-sm-6 ">
			<label class="col-sm-4 fm-label">部门名称</label>
			<div class="col-sm-8 fm-control">
				<input type="text" name="name" value="${upmsDepartmentPO.name}" class="form-control easyui-validatebox" data-options="required:true,validType:['length[0,64]']" />
				<input type="hidden" name="departmentId" value="${upmsDepartmentPO.departmentId}" />
			</div>
		</div>
		
		<div class="form-group col-sm-6">
			<label class="col-sm-4 fm-label">部门图标</label>
			<div class="col-sm-8 fm-control" style="">
				<span class="input-icon icon-left">
					<input type="text" name="icon" class="form-control easyui-validatebox" data-options="required:true,validType:['length[0,64]']"  value="${upmsDepartmentPO.icon}" onchange="changeIcon(this)" />
					<i class="fa ${upmsDepartmentPO.icon}"></i>
				</span>
			</div>
		</div>
	</div> 
	
	<div class="row">
		<div class="form-group col-sm-6 ">
			<label class="col-sm-4 fm-label">所属公司</label>
			<div class="col-sm-8 fm-control">
				<label class="fm-label">${upmsCompanyPO.name}</label>
				<input type="hidden" name="companyId" value="${upmsCompanyPO.companyId}" />
			</div>
		</div>
	</div> 
	
	
	
	<!--表单操作按钮区-->
    <div class="but-row-bottom-shadow"></div>
    <div class="buts-row-bottom row ">
		<a href="javascript:submitForm();"  class="btn btn-success">
				<i class="fa fa-check"></i>提 交</a>
		<a href="javascript:closeWindow('修改部门');" class="btn btn-default">
				<i class="fa fa-times"></i>取 消</a>
	</div>
</form>
</body>
</html>
<script type="text/javascript">

//提交表单
function submitForm(){
	$("#data_form").form('submit', {
		url : '${basePath}/department/department-update',
		onSubmit: function (){
			showPageShade();//当提交时候，显示遮罩层
			if(!$(this).form('validate')){//页面验证
				hiddenPageShade();//未成功，隐藏遮罩层
				return false;
			}
			return true;
        },
		success : function(result) {
			hiddenPageShade();//成功后，隐藏遮罩层
			closeWindowRefrresh("修改部门");
		}
	});
}



function changeIcon(obj){
	var $this=$(obj);
	var $i=$this.next("i.fa");
	var cls="fa "+$this.val();
	$i.attr("class",cls);
}
</script>


